import CustomCode.CustomSubject;
import CustomCode.ProgressNotifier;
import CustomCode.BaseSubject;
import CustomCode.TextNotifier;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class Main {

    private static Logger logger = LogManager.getLogger(Main.class.getName());

    public static void main(String[] args) {
        System.out.println("******************有日志记录的观察者模式模板******************");

        BaseSubject subject = new CustomSubject();

        subject.addNotifier(new TextNotifier());
        logger.debug("文本通知器注册成功");
        subject.addNotifier(new ProgressNotifier());
        logger.debug("进度通知器注册成功");
        subject.addNotifier(new TextNotifier());
        logger.debug("文本通知器注册成功");

        subject.notifyObservers();
    }
}